/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utilidades;

import data.ConexionBD;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author pc
 */
public class Titulos {

    ConexionBD baseDeDatos;
    ResultSet resulset;
    int idCurso;
    String nombreCurso;
    int nivel;
    int tutor;

   public  Titulos() {
        Lector lector = new Lector();
         baseDeDatos = new ConexionBD();
        baseDeDatos.connect();
    }

    public ArrayList<String> getlistaTitulos() {

        ArrayList<String> listaTitulos = new ArrayList();

        resulset = baseDeDatos.select("select nombre from titulo;");
        try {
            while (resulset.next()) {
                
                listaTitulos.add(resulset.getString(1));
            }
        } catch (SQLException ex) {
            Logger.getLogger(Titulos.class.getName()).log(Level.SEVERE, null, ex);
        }
        return listaTitulos;

    }
}
